package com.jsh.erp.utils;

public class BaseResponseInfo {
    public int code;
    public Object data;

    public BaseResponseInfo() {

    }

    public static BaseResponseInfo fail(int code) {
        BaseResponseInfo baseResponseInfo = new BaseResponseInfo();
        baseResponseInfo.code = code;
        return baseResponseInfo;
    }

    public static BaseResponseInfo fail(int code, Object errMsg) {
        BaseResponseInfo baseResponseInfo = new BaseResponseInfo();
        baseResponseInfo.code = code;
        baseResponseInfo.data = errMsg;
        return baseResponseInfo;
    }

    public static BaseResponseInfo success(Object data) {
        BaseResponseInfo baseResponseInfo = new BaseResponseInfo();
        baseResponseInfo.code = 200;
        baseResponseInfo.data = data;
        return baseResponseInfo;
    }

    public static BaseResponseInfo success() {
        BaseResponseInfo baseResponseInfo = new BaseResponseInfo();
        baseResponseInfo.code = 200;
        baseResponseInfo.data = "success";
        return baseResponseInfo;
    }
}
